<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .searchbox {
            margin: 10px;
            display: flex;
            align-items: center;
        }

        .searchbox input {
            flex: 1;
            height: 42px;
            background-color: #f5f5f5;
            outline: none;
            border: none;
            padding-left: 20px;
            border-radius: 20px;
        }

        .searchbox span {
            width: 60px;
            text-align: center;
        }

        .block {
            margin: 10px;
        }

        .block .title {
            font-weight: bold;
            padding: 10px 0;
        }

        .block .list span {
            display: inline-block;
            background-color: #f5f5f5;
            padding: 5px 10px;
            border-radius: 5px;
            margin-right: 10px;
            margin-bottom: 10px;
        }
        .block2 span{
            padding: 5px 10px;
            background-color: #aaa;
            margin-right: 10px;
            margin-bottom: 5px;
            display: inline-block;
            border-radius: 10px;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="searchbox">
            <!-- v-model 表单数据绑定, 也是唯一一个具有双向数据绑定特点的指令 -->
            <!-- v-model 指令主要配合表单元素使用 -->
            <input type="text" placeholder="输入搜索店铺" v-model="searchText">
            <span @click="search">搜索</span>
        </div>
        <div class="block">
            <div class="title">历史搜索</div>
            <div class="list">
                <span v-for="(item,index) in searchArr"> {{item}} </span>
            </div>
        </div>
        <div class="block2">
            <div class="title">搜索发现</div>
            <!-- v-for 列表渲染, item 是数组元素, index 是元素下标 -->
            <!-- v-for="(item,index) in 数组" -->
            <span v-for="(item,index) in arr">{{item}}</span>

        </div>
    </div>

    <script src="./vue-2.5.21.js"></script>
    <script src="./历史记录.js"></script>
</body>

</html>